
namespace createjs {

	export class DisplayProps {
		visible: boolean;
		alpha: number;
		matrix: Matrix2D;

		constructor(visible?, alpha?, matrix?) {
			this.setValues(visible, alpha, matrix);
		}

		setValues(visible, alpha, matrix?) {
			this.visible = visible == null ? true : !!visible;
			this.alpha = alpha == null ? 1 : alpha;
			this.matrix = matrix || (this.matrix && this.matrix.identity()) || new Matrix2D();
			return this;
		};

		append(visible, alpha, matrix?) {
			this.alpha *= alpha;
			this.visible = this.visible && visible;
			matrix && this.matrix.appendMatrix(matrix);
			return this;
		};

		prepend(visible, alpha, matrix?) {
			this.alpha *= alpha;
			this.visible = this.visible && visible;
			matrix && this.matrix.prependMatrix(matrix);
			return this;
		};

		identity() {
			this.visible = true;
			this.alpha = 1;
			this.matrix.identity();
			return this;
		};

		clone() {
			return new DisplayProps(this.visible, this.alpha, this.matrix.clone());
		};
	}

}
